<!DOCTYPE html>
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js"> <!--<![endif]-->
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>用户登录</title>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta name="description" content="Free HTML5 Template by FreeHTML5.co"/>
    <meta name="keywords" content="free html5, free template, free bootstrap, html5, css3, mobile first, responsive"/>
    <!-- Facebook and Twitter integration -->
    <meta property="og:title" content=""/>
    <meta property="og:image" content=""/>
    <meta property="og:url" content=""/>
    <meta property="og:site_name" content=""/>
    <meta property="og:description" content=""/>
    <meta name="twitter:title" content=""/>
    <meta name="twitter:image" content=""/>
    <meta name="twitter:url" content=""/>
    <meta name="twitter:card" content=""/>

    <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
    <link rel="shortcut icon" href="favicon.ico"/>

    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,300' rel='stylesheet' type='text/css'/>

    <link rel="stylesheet" href="assets/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="assets/css/animate.css"/>
    <link rel="stylesheet" href="assets/css/style.css"/>
    <link rel="stylesheet" href="assets/css/sweetalert2.min.css"/>

    <!-- Modernizr JS -->
    <script src="assets/js/modernizr-2.6.2.min.js"></script>
    <!-- FOR IE9 below -->
    <!--[if lt IE 9]>
    <script src="assets/js/respond.min.js"></script>
    <![endif]-->

</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-4 col-md-offset-4">
            <!-- Start Sign In Form -->
            <form action="" onsubmit="return false;" class="fh5co-form animate-box" data-animate-effect="fadeIn">
                <h2>书城管理员登录</h2>
                <div class="form-group">
                    <label for="name" class="sr-only">Username</label>
                    <input type="text" class="form-control" id="name" placeholder="Username" autocomplete="off"/>
                </div>
                <div class="form-group">
                    <label for="password" class="sr-only">Password</label>
                    <input type="password" class="form-control" id="password" placeholder="Password" autocomplete="off"/>
                </div>
                <!--<div class="form-group">-->
                <!--<label for="remember"><input type="checkbox" id="remember"> Remember Me</label>-->
                <!--</div>-->
                <div class="form-group">
                    <input id="login" onclick="doAjax(this)" type="submit" value="登录" class="btn btn-primary"/>
                </div>
            </form>
            <!-- END Sign In Form -->
        </div>
    </div>
    <div class="row" style="padding-top: 60px; clear: both;">
    </div>
</div>
<!-- jQuery -->
<script src="assets/js/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="assets/js/bootstrap.min.js"></script>
<!-- Placeholder -->
<script src="assets/js/jquery.placeholder.min.js"></script>
<!-- Waypoints -->
<script src="assets/js/jquery.waypoints.min.js"></script>
<!-- Main JS -->
<script src="assets/js/main.js"></script>
<!-- sweetalert2 -->
<script src="assets/js/sweetalert2.min.js"></script>
<!--自定义-->
<script type="text/javascript">
    function doAjax(self) {
        var argv = $(self).attr("id");
        var name = $("#name").val();
        var password = $("#password").val();
        $.post("post/adminlogin.do", {name: name, password: password}, function (data) {
//                显示返回状态信息
            sweetAlert("", data.data, data.message);
//                登录后跳转
            if (!(data.code - 200)) {
                setTimeout(function () {
                    window.location.href = "admin/books";
                }, 2000)
            }
        }, "json");
    }
</script>

</body>
</html>

